#include <iostream>
#include <cmath>
#define N 100

using namespace std;

void readintVector(float array[], int elements){
for (int i=0; i<elements; i++){
	cout<<"a["<<i<<"]=";
	cin>>array[i];
	cout<<"\n";}
}

int dif_max_abs(float array[], int elements)
{	
int i;
int dif=0;
for(i=1;i<elements;++i)
	if(abs(array[i]-array[i-1])>dif)
		dif=abs(array[i]-array[i-1]);
return dif;			
}

int main(){
float array[N];
int elements;
int dif;
cout<<"Type the number of elements you want in the array: ";
cin>>elements;

readintVector(array, elements);

cout<<"The original array is ";
for(int i=0; i<elements; i++){
	cout<<array[i]<<" ";}
cout<<endl;
dif =dif_max_abs(array, elements);
cout<<"The absolute maxim difference is: "<< dif << endl;

return 0;
}

